﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DC2010.Objects.Base;
using DC2010.Logic;
using DC2010.Objects.Data;

namespace DC2010.Effects
{
    /// Effect description
    /// ------------------
    /// This efect is used for object which light under certain conditions. For example Illumulet
    /// which light if it is worn on the neck. However light remains constant and it does not fade
    /// with time. Direction can be also inputted, then instead on increasing light value. Dungeon
    /// will become much more darker.
    /// 
    /// Param1 - Amount of % to added
    /// Param2 - UNUSED
    /// Param3 - UNUSED
    /// Param4 - UNUSED
    /// Param5 -  UNUSED
    /// sParam1 - Direction. Values are: "+", "-".
    /// sParam1 - UNUSED
    /// 
    public class P_InfiniteLight_Effect : EffectLogic
    {
        public float LightAmount { get; set; }
        public string Direction { get; set; }

        public P_InfiniteLight_Effect(EffectData ed)
            : base(ed)
        {
            LightAmount = 0;
            //Direction = this.Info.Params.sParam1;
            ed.IsActive = true;

            ShortName = "Infinite light";
            LongName = "Effect adds a light to environment. This light is permanent. Use to light up scenes.";
            EffectType = EffectType.Pump; 
        }

        public override void Pump(BaseObject aTarget)
        {        
            base.Pump(aTarget);

            //if (CheckPumpCondition(aTarget))
            //{

            //    if ((Direction!=null)&&(Direction == "-"))
            //    {
            //        int percent = this.Info.Params.Param1;
            //        float fPercent = (float)percent / 100;

            //        LightAmount = 0 - fPercent;
            //    }
            //    else
            //    {
            //        int percent = this.Info.Params.Param1;
            //        float fPercent = (float)percent / 100;

            //        LightAmount = fPercent;
            //    }

            //    Root.I.GameSystem.Light.AddLightEffect(this, this.Info.Id);
            //}
        }
    }
}
